<!-- 活动列表 -->
<template>
	<view class="item flex flex-column">
		<view class="icon" @click="link(item.activityId)">
			<u-image width="100%" height="388rpx" :src="item.activityImage"></u-image>
		</view>
		<view class="detail">
			<view class="title flex justify-between" @click="link(item.activityId)">
				<text class="text flex-shrink">
					{{item.activityName}}
				</text>
				<view class="money">
					<text class="icon">
						¥
					</text>
					<text class="num">
						{{item.activityPrice}}
					</text>
				</view>
			</view>
			<view class="city">
				{{item.activityAddress}}
			</view>
			<view class="sign flex justify-between">
				<view class="article flex justify-between">
					<view class="long flex justify-center align-center">
						<view class="bo">

						</view>
						<view class="to" :style="{width:start + 'rpx'}">

						</view>
					</view>
					<view class="proportion">
						<text class="before">{{item.activltyApply}}</text>
						<text class="after">/{{item.activltyOnline}}</text>
					</view>
				</view>
				<view v-if="!item.type" class="up flex justify-center align-center" @click="link(item.activityId)">
					立即报名
				</view>
				<view v-if="item.type" class="u flex justify-center align-center" @click="link(item.activityId)">
					已报名
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "activity",
		props: {
			item: Object
		},
		data() {
			return {
				
			};
		},
		computed:{
			start(){
				return this.item.activltyApply/this.item.activltyOnline*367 
			}
		},
		methods:{
			//跳转至详情页
			link(id){
				console.log(id)
				uni.setStorageSync('pageNum',id)
				uni.navigateTo({
					url:'/pagesB/activityDetail/activityDetail'
				})
			}
		}
	}
</script>

<style lang="scss">
	.item {
		border-radius: 24rpx;
		overflow: hidden;
		background-color: #FFFFFF;
		box-shadow: 0px 11px 13px 3px rgba(187, 187, 187, 0.18);
		width: 690rpx;
		margin-bottom: 30rpx;

		.icon {
			width: 690rpx;
		}

		.detail {
			padding: 30rpx;

			.title {
				.text {
					font-weight: bold;
					color: #333333;
					font-size: 32rpx;
				}

				.money {
					color: #0265EB;

					.icon {
						font-size: 24rpx;
					}

					.num {
						font-size: 40rpx;
						font-weight: bold;
					}
				}
			}

			.city {
				color: #333333;
				font-size: 24rpx;
				margin: 10rpx 0;
			}

			.sign {
				.article {
					.long {
						position: relative;

						.bo {
							width: 367rpx;
							height: 5rpx;
							background: #EEEEEE;
							border-radius: 3px;
						}

						.to {
							position: absolute;
							top: 50%;
							left: 0;
							transform: translateY(-50%);
							height: 5rpx;
							background: #0265EB;
							border-radius: 3px;
						}
					}

					.proportion {
						margin-left: 20rpx;

						.before {
							color: #0265EB;
							font-weight: bold;
							font-size: 36rpx;
						}

						.after {
							color: #666666;
							font-size: 24rpx;
						}
					}
				}

				.up {
					width: 156rpx;
					height: 54rpx;
					color: #FFFFFF;
					background-image: url("https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/square/anniu.png");
					background-size: 100% 100%;
					line-height: 1;
				}
				.u {
					width: 156rpx;
					height: 54rpx;
					color: #FFFFFF;
					background-image: url("https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/square/anniu.png");
					background-size: 100% 100%;
					line-height: 1;
				}
				// .ups {
				// 	width: 156rpx;
				// 	height: 54rpx;
				// 	color: #FFFFFF;
				// 	background-image: url("https://sanfuzhide.oss-cn-hangzhou.aliyuncs.com/square/anniu.png");
				// 	background-size: 100% 100%;
				// 	line-height: 1;
				// }
			}
		}

	}
</style>
